 /*-----------------------------------------------File Info------------------------------------------------
** File Name:               uart user.h  
** Last modified date:      2016.09.8
** Last version:            V0.1
** Description:             
**
**--------------------------------------------------------------------------------------------------------            
** Created date:            2016.09.8
** author:                  YLY
** Version:                 V0.1
** Descriptions:            ????
**--------------------------------------------------------------------------------------------------------*/

#ifndef _V_SPI_USER_H_
#define _V_SPI_USER_H_
/*   硬件相关头文件     */
#include "gd32e230.h"
#include "systick.h"
#include <stdio.h>
#include "gd32e230c_eval.h"

//#define V_SPI_CLK  	  
//#define V_SPI_DO 	
//#define V_SPI_DI  	1
//#define V_SPI_CS 	  





#define V_SPI_CS_HI() 	gpio_bit_set(GPIOA,GPIO_PIN_4)
#define V_SPI_CS_LOW()	gpio_bit_reset(GPIOA,GPIO_PIN_4)

#define V_SPI_CLK_HI()  gpio_bit_set(GPIOA,GPIO_PIN_5)
#define V_SPI_CLK_LOW()  gpio_bit_reset(GPIOA,GPIO_PIN_5)

//#define V_SPI_DI_HI()	gpio_bit_set(GPIOA,GPIO_PIN_6)
//#define V_SPI_DI_LOW()	gpio_bit_reset(GPIOA,GPIO_PIN_6)
#define V_SPI_DI	gpio_input_bit_get(GPIOA,GPIO_PIN_6)


#define V_SPI_DO_HI()	gpio_bit_set(GPIOA,GPIO_PIN_7)
#define V_SPI_DO_LOW()	gpio_bit_reset(GPIOA,GPIO_PIN_7)




extern void vVspiInit(void);
extern uint8_t ucVSpiWriteReadByte(uint8_t ucByte);
extern uint8_t ucVspiSetReg(uint8_t ucRegAddr, uint8_t ucRegVal);
extern uint8_t ucVspiGetReg(uint8_t ucRegAddr);





#endif /*_V_SPI_USER_H_  */


